<template>
  <div class="homeRecom">
    <div v-for="item in homeRecommend" :key="item.acm" class="recomItem">
      <div class="recomImg">
        <a :href="item.link">
          <img :src="item.image" @load="homeRecomImgLoad"/>
        </a>
      </div>
      <div>{{item.title}}</div>
    </div>
  </div>
</template>

<script>
export default {
  name: "HomeRecom",
  props: {
    homeRecommend: {
      type: Array,
      default() {
        return [];
      }
    }
	},
	data(){
		return{
			isLoad:false
		}
	},
	methods:{
		homeRecomImgLoad(){
			if(!this.isLoad){
				this.$emit("homeRecomImgLoad")
				this.isLoad = true
			}
		}
	}
};
</script>

<style>
.homeRecom{
	display: flex;
	padding: 10px 0 15px;
	border-bottom:8px solid #ccc;;
	text-align: center;
	font-size: 14px;
}
.homeRecom .recomItem{
	flex: 1;
}
.homeRecom .recomItem .recomImg{
	width: 65px;
	height: 65px;
	margin: 0 auto 8px;

}
.recomImg img{
	width: 100%;
}
</style>
